'use strict';var _1o;
{let l,k={};var _So=function(a,b=null,c=null,g=0){let m=a.in(_Uf,_ft,_Fr);b={type:a,content:b};if(c){var e=2130706431*Math.random()|0;_ih(b,...m?["content"]:[]).callback=e+l}try{return d.postMessage(b),c&&(k[e]=c,g&&setTimeout(()=>q(e,_Aw),g)),a==_ba&&_Bh(void 0),!0}catch(h){return c&&setTimeout(c),!1}},_fw=(a,b,c)=>g=>_So(a,b,g,c);let q=function(a,b){let c=k[a];c&&(delete k[a],c(b))},w=function(){for(let a in k)q(a,"")},E=(()=>{function a(e,h){_Ck(h.needed?"no-hook":"no-hook-false");g||(c||(c=setTimeout(()=>
{b=0;c=null},15E3)),5!=++b||m||(g=!0,_9p(x=>{g=!1;_6p(e,h.add({answer:x?"Disable notice":"Keep showing"}));_Vg("noHookConflictMsg",m=x)})))}let b=0,c,g,m=_5e("noHookConflictMsg");return e=>{let h=e.type;delete e.type;if("no-hook-notice"==h)a(h,e);else{if("invalidExtId"==h){if(_xk())return}else if("APDL"==h){if(_Gu=!0,_Pt(e.result))return}else if("NH-error"==h&&3221225477==e.code){_Ck("segFault");return}_6p(h,e)}}})(),y=_Qu;const z={[_nf]:a=>{let b=_6a[a.id-_jy+_zg];if(b&&(a.trigInstId=b(a.trigInstId),
!a.trigInstId))return;a.mouseGest&&(a.trigInstId=_3o(a.trigInstId,{usePrevMousePos:a.mouseGest}));a.extEvtData&&("tabs"in a.extEvtData&&(a.extEvtData.tabs=_Vs(a.extEvtData.tabs)),a.trigInstId=_3o(a.trigInstId,a.extEvtData));_1w(16777215&a.id-_jy,a.trigInstId)},[_2k]:a=>_Dd({joysticksOrder:a.list}),[_Yg]:a=>_Xp(a.hWnd,a.noEvt),[_8p]:a=>_Rf(a.list),[_7k]:a=>_sr(a.state?_fd:_wh,_Rk[a.hWnd]),[_Gr]:a=>{_Bh(_jd(a));a.noEvt||_yu(_sd)},[_xy]:a=>q(a.id,a.params),[_Jd]:a=>y(_Iy(a.actionType),a.actionSpec),
[_Rw]:E,[_as]:a=>F(a.id,a.type,a.chunk),[_Vo]:a=>_Hf=a.verNum,[_Dw]:a=>{_si=(_Rr=a.exeName.toLowerCase()).replace(/\.[^.]+$/,"");_Rr||_6p("noBrwrName")},[_4d]:_3a,[_2s]:a=>_n(a.file,"blob")(b=>_ay(a.callback,b?b.size:_cw)),[_ig]:a=>{}};let f={},F=(a,b,c)=>{null==f[a]&&(f[a]="list"==b?[]:"",delete f[(a+9)%20+1]);switch(b){case "text":f[a]+=c;break;case "list":f[a].push(...c);break;case "bin":f[a]+=atob(c)}};var _Cu=function(a){let b=a&&a.chunkedData;b&&(a=f[b],delete f[b]);return a},_Nf=function(a,
b=_Qu){_So(_pt,a);b&&(y=b)};let A=function(a,b){b!=d?_6p("rogueNatHost",{place:"msgLstnr",currPort:typeof d}):(_Mg(a)?(b=a[0],a=a[1]):(b=a.msgType,delete a.msgType),(z[b]||_Qu)(a))};var _tr=a=>z.add(a),_co=(a,b)=>A([a,b],d),_Jf;let d,r,n=0,t={},u=0,v=0,p=100,B=function(a){clearTimeout(r);r=setTimeout(_mj(),1E3*a)},C;var _mj=_wj(function*(a){_Zh();C=Date.now();d=_Ky.runtime.connectNative(_4k[3]+"");d.onMessage.addListener(A);d.onDisconnect.addListener(c=>{c!=d?_6p("rogueNatHost",{place:"onDisconnect",
currPort:typeof d}):(w(),c.connectSuccess&&(c=Date.now()-_ar,500>c?n=Math.min(3,n+.5):3E3<c&&(n=0),B(n)),d=null,_Jf=!1)});_fj=[];_co(_sf);_Ms=null;yield _Pi(p);let b=yield D();if(b){if(b==_Aw)p=Math.min(1E3,p+100);else if("NH0fail"==b)++v;else if("notConnected"!=b){if(5==++u){let c=Object.keys(t);1==c.length&&c[0]==_ky||_6p("NH-startFail",{lastError:b,allErrors:c})}t[b]=!0}_Zh();a&&b.in(_Aw,_ky)?(yield _Pi(800),b=yield _mj(a-1)):B(Math.min(8,Math.pow(Math.max(u,v)+1,.4)))}else t={},v=u=0,p=100;return!b}),
_Zh=function(){clearTimeout(r);d&&(d.disconnect(),w())};let D=_wj(function*(a){86397E3<Date.now()%864E5&&(yield _Pi(3E3));_jy=Date.now()/864E5|0;l=13625;let b=yield _fw(_sp,{fileName:_Br},9E3);if(void 0===b)return"notConnected";if(b==_Aw)return b;if(_Pt(b))return"NH0fail";d.connectSuccess=!0;_ar=Date.now();if(b)a||b!=_oa||(yield _Od("del /Q /F "+_2r),(b=yield _ok(_Br,yield _Pu(_Jk,"binary")))||(b=yield D(!0)));else if(_Rd?_ry(Date.now()-C):(_6p("NH-connect"),_pd(["LOCAL","natHostInstalled"],_Rd=!0,
0)),l=parseInt(_xg.substr(2,3),36),f={},_So(_ce,{iTime:_Fg,crVer:_Ok,variant:_dg}),_Of(),_Jf=!0,yield c=>_oy()(()=>{_Ty();c()}),_So(_pa,{states:_gy}),yield c=>_bh(g=>_mg(g,c)),_So(_B),!G++&&!_Ma("noStupEvt")){for(let c of["tabs","sess"])_Od(`forfiles /m *.${c} /d -10 /c "cmd /c del /F /Q @path"`)();_sr(_Ae)}return b}),G=0}let _ay=(l,k)=>_So(_us,{id:l,params:k});
